<?php

require_once('../../SiteIncludes.GLOBAL.php');
    
    if(EclipseMDE::runningOnMod_Rewrite() === false) {
	// Security Guard, Do Not Let This be accessed by any other means than mod_rewrite
	$gVAR['e'] = '404';
	require_once('error_handler.php');
	die();
    }
    
    if(isset($_LOGGEDINUSER) === true && $_LOGGEDINUSER !== false && $_LOGGEDINUSER->get_priv_adm() === true) {
	if(isset($gVAR['alias']) === true) {
	    /**
	     * We are editing a project here, be that we are either editing or have just posted an edit
	     */
	    $_ADMINEDIT = true;
	    require_once('../editView.php');
	} /*elseif(isset($gVAR['search']) === true) {
	} */else {
	    /**
	     * We are on the search page 
	     */
	// Add Javascript for cleanup script and confirmer script
	$TemplateEngine->add_postloadScript('<script type="text/javascript" src="/js/ajaxCleanup.js"></script>');
	$TemplateEngine->add_postloadScript('<script type="text/javascript" src="/js/ajaxConfirmer.js"></script>');
	$TemplateEngine->add_postloadScript('<script type="text/javascript" src="/js/EMDE.js"></script>');

	// Add the search box from the templater
	$TemplateEngine->create_content_html($Templater->project_searchbox(true));

	// Hide sidebar
	$TemplateEngine->setHasSidebar(false);
	$TemplateEngine->setCentralContentFullWidth(true);
	$TemplateEngine->render();
	}
	
    } else {
	$gVAR['e'] = 403;
	require_once('../error_handler.php');
	die();
    }
    
?>
